package cn.com.starbucks.activity.service;

import cn.com.starbucks.activity.bean.dto.TestDTO;
import cn.com.starbucks.activity.entity.Test;
import cn.com.starbucks.activity.manager.TestManager;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * Description:
 *
 * @author tecsmile@outlook.com
 * @version 1.0
 * @date 2021/4/14 5:39 下午
 **/

@Service
@AllArgsConstructor
public class TestService {
    private final TestManager testManager;

    public TestDTO detail(Long id) {
        Test test = testManager.getById(id);
        TestDTO dto = new TestDTO();
        BeanUtils.copyProperties(test, dto);
        return dto;
    }

    public String redisVal(String key) {
        return testManager.getRedisVal(key);
    }



}
